{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Avatar/index.tsx\";\nimport React from \"react\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\nimport { Carousel } from \"../index\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Avatar = _ref => {\n  let {\n    contentList,\n    alt,\n    stringForGenerateColor,\n    stringForFirstCharacter,\n    shortAvatar = true\n  } = _ref;\n  if (contentList && contentList.items && contentList.items.length > 0 && shortAvatar) {\n    return /*#__PURE__*/_jsxDEV(\"img\", {\n      className: \"avatar\",\n      src: contentList.items[0].link,\n      alt: 'Avatar ' + alt\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 10,\n      columnNumber: 13\n    }, this);\n  } else if (shortAvatar) {\n    const {\n      colors\n    } = generateAvatarByNickname(stringForGenerateColor);\n    const firstChar = stringForFirstCharacter[0].toUpperCase();\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      style: {\n        background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`\n      },\n      className: \"avatar avatar--symbol\",\n      children: firstChar\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 17,\n      columnNumber: 13\n    }, this);\n  } else {\n    return /*#__PURE__*/_jsxDEV(Carousel, {\n      width: 200,\n      children: [\"contentList?.items.forEach(item => \", /*#__PURE__*/_jsxDEV(\"img\", {\n        className: \"avatar\",\n        src: item.link,\n        alt: 'Avatar ' + alt + item.id\n      }, item.id, false, {\n        fileName: _jsxFileName,\n        lineNumber: 28,\n        columnNumber: 21\n      }, this), \")\"]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 26,\n      columnNumber: 13\n    }, this);\n  }\n};\n_c = Avatar;\nexport default Avatar;\nvar _c;\n$RefreshReg$(_c, \"Avatar\");","map":{"version":3,"names":["React","generateAvatarByNickname","Carousel","Avatar","contentList","alt","stringForGenerateColor","stringForFirstCharacter","shortAvatar","items","length","link","colors","firstChar","toUpperCase","background","color","colorLighten","item","id"],"sources":["/data/messenger.client/src/components/Avatar/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {AvatarProps} from \"../../models/props/AvatarProps\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\nimport {Carousel} from \"../index\";\n\nconst Avatar: React.FC<AvatarProps> = ({contentList, alt, stringForGenerateColor, stringForFirstCharacter, shortAvatar = true}) => {\n    if (contentList && contentList.items && contentList.items.length > 0 && shortAvatar) {\n        return (\n            <img className='avatar' src={contentList.items[0].link} alt={'Avatar ' + alt}/>\n        );\n    } else if (shortAvatar) {\n        const {colors} = generateAvatarByNickname(stringForGenerateColor);\n        const firstChar = stringForFirstCharacter[0].toUpperCase();\n\n        return (\n            <div\n                style={{background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`}}\n                className='avatar avatar--symbol'\n            >\n                {firstChar}\n            </div>\n        );\n    } else {\n        return (\n            <Carousel width={200} >\n                contentList?.items.forEach(item => {\n                    <img key={item.id} className='avatar' src={item.link} alt={'Avatar ' + alt + item.id}/>\n                })\n            </Carousel>\n        );\n    }\n}\n\nexport default Avatar;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,OAAO,eAAe;AACtB,SAAQC,QAAQ,QAAO,UAAU;AAAC;AAElC,MAAMC,MAA6B,GAAG,QAA6F;EAAA,IAA5F;IAACC,WAAW;IAAEC,GAAG;IAAEC,sBAAsB;IAAEC,uBAAuB;IAAEC,WAAW,GAAG;EAAI,CAAC;EAC1H,IAAIJ,WAAW,IAAIA,WAAW,CAACK,KAAK,IAAIL,WAAW,CAACK,KAAK,CAACC,MAAM,GAAG,CAAC,IAAIF,WAAW,EAAE;IACjF,oBACI;MAAK,SAAS,EAAC,QAAQ;MAAC,GAAG,EAAEJ,WAAW,CAACK,KAAK,CAAC,CAAC,CAAC,CAACE,IA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